package com.db.admin;
import java.io.Reader;
import java.util.*;

import com.db.organization.*;
import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class AdminJobDAO {
	private static SqlMapClient sqlmap;
	private static AdminJobDAO jdao;
	
	private AdminJobDAO() {
		Reader reader;
		try{
			reader = Resources.getResourceAsReader("com/db/config/SqlMapConfig.xml");
			sqlmap = SqlMapClientBuilder.buildSqlMapClient(reader);
		}catch(Exception ex) {
			System.out.println(ex.getMessage());
		}
	}
	public static synchronized AdminJobDAO newInstance()	 {
		if(jdao == null)
			jdao = new AdminJobDAO();
		return jdao;
	}
	
	public List<JobVO> JobList() throws Exception {
		List<JobVO> list = new ArrayList<JobVO>();
		return sqlmap.queryForList("JobList");
		
	}
}
